// const MathModel = require('./../service/MathModel')
// const buildingList = MathModel.getBuildingList({
//     openPrice: 48199, 
//     direction: 'sell', 
//     leverage: 50,
//     freeAmount: 271,
//     protectModeIndex: 9,
//     customSaveNums: 6
// })
// debugger


const Decimal = require("decimal.js");
const MathModel = require('./../service/MathModel')
const {
    // BollStatus,
    OrderDirection,
    // OrderDirectionDesc
  } = require("./../constants");
const buildingList = MathModel.getBuildingList({
    openPrice: 27516,
    direction: OrderDirection.SELL,
    leverage: 95,
    freeAmount: 89
})
const list = buildingList.map(item => ({
    buildRatio: Decimal(item.buildRatio).mul(100).toFixed(2) + '%',
    buildPrice: item.buildPrice,
    totalBuildRatio:Decimal(item.totalBuildRatio).mul(100).toFixed(2) + '%',
    buildAvgPrice: item.buildAvgPrice
}))
const priceList = list.map(item => (item.buildPrice ))
console.log(list, priceList, priceList.length, list[priceList.length - 1].buildPrice - list[0].buildPrice, (list[priceList.length - 1].buildPrice - list[0].buildPrice) / list[0].buildPrice)

